import cv2
import matplotlib.pyplot as plt
import numpy as np
from numba import uint8

def cv_show(name,img):
    cv2.imshow(name,img)
    cv2.waitKey(0)
    cv2.destroyAllWindows()

img = cv2.imread('C:/Users/nic/Desktop/opencv/picture/circle.JPG')
img = cv2.resize(img,(400,600))
sobelx = cv2.Sobel(img,cv2.CV_64F,1,0,ksize=3)
sobelx = cv2.convertScaleAbs(sobelx)
sobely = cv2.Sobel(img,cv2.CV_64F,0,1,ksize=3)
sobely = cv2.convertScaleAbs(sobely)

sobelxy = cv2.addWeighted(sobelx,0.5,sobely,0.5,0)

#stack
res = np.hstack((sobelx,sobely,sobelxy))
cv_show('all_image',res)








